<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
  <!-- Google tag (gtag.js) -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-0ZJQN9ZQ47"></script>
  <script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-0ZJQN9ZQ47');
  </script>
  <meta charset="utf-8">
  <title>关于文本二维码这件小事 &mdash; 褪色的抽象</title>
  <meta name="author" content="Kaffa">






  <!-- http://t.co/dKP3o1e -->
  <meta name="HandheldFriendly" content="True">
  <meta name="MobileOptimized" content="320">
  <meta name="viewport" content="width=device-width, initial-scale=1">


    <link href="./favicon.ico" rel="icon">

  <link href="./theme/css/main.css" media="screen, projection"
        rel="stylesheet" type="text/css">
  <!--
  <link href="//fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic"
        rel="stylesheet" type="text/css">
  <link href="//fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic"
        rel="stylesheet" type="text/css">
  -->
</head>

<body>
  <header role="banner"><hgroup>
  <h1><a href="./"><span style="color:#52A2C6">褪</span>
<span style="color:#6791BC">色</span>
<span style="color:#7C80B2">的</span>
<span style="color:#916FA8">抽</span>
<span style="color:#A65E9E">象</span></a></h1>
    <h2>kaffa's blog</h2>
</hgroup></header>
  <nav role="navigation"><ul class="subscription" data-subscription="rss">
</ul>


<ul class="main-navigation">
    <li><a href="/">首页</a></li>
    <li><a href="/category/sui-bi.html">随笔</a></li>
    <li><a href="/category/yue-du.html">阅读</a></li>
    <li><a href="/category/ren-wen.html">人文</a></li>
    <li><a href="/category/zi-ran.html">自然</a></li>
    <li><a href="/category/ri-zhi.html">日志</a></li>
</ul></nav>
  <div id="main">
    <div id="content" class="bronze">
<div>
  <article class="hentry" role="article">
<header>
      <h1 class="entry-title">关于文本二维码这件小事</h1>
    <p class="meta">
<time datetime="2018-07-27T12:00:00+08:00" pubdate>2018-07-27 周五</time>    </p>
</header>

  <div class="entry-content"><div class="section" id="section-2">
<h2>文本二维码</h2>
<p>简单讲，二维码是一个算法，可以把信息编码为0和1，也就是白和黑，也就是常见的二维码。大多情况下，二维码用一个方形的图片表达，可以跨各种介质传播。</p>
<p>但由于一个很特殊的软件，我们有将二维码从远程机器传递到本地文本终端的需求。因此，引出了文本二维码这个议题:</p>
<pre class="literal-block">
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▀▄█▀ █▀ █▀█▄▀█ ▄▄▄▄▄ █
█ █   █ █▄   ▄▀ ▀▄▄█▀▀█ █   █ █
█ █▄▄▄█ █ ▀█▀█▄█▀   ▀▀█ █▄▄▄█ █
█▄▄▄▄▄▄▄█ ▀▄█ █ ▀▄▀▄▀ █▄▄▄▄▄▄▄█
█▄▄█▄▀▀▄▄▀█ ▀█▀ ▀ ▀█▄█▀ ▄▄▀▄▄▀█
█ ▀▀▀▄▀▄ █▄▄██ ██ ▄ ▄▄  ▄ ▄  ██
█▄ ▄███▄███▀▀ █▀▀█▄█  ▀▄██▄█▄▄█
██▄▄ ▄█▄ ▄▀██ ▀▀█ ▀▀▀▄ ▀██ ▄ ▄█
█▄▀▀▄▄ ▄▄▄ ▀▄██▄█▄ ██▄▄▀▀█▀█▄▀█
█▄█▄▀▀ ▄▀▄█▄▀██▀█▄▀▀█▄▄▄▄▀██  █
█▄██▄▄▄▄█  ▀  ▄▀█ █▄▄ ▄▄▄ █ ▀▀█
█ ▄▄▄▄▄ █▄█▄   █▀▀▄▀█ █▄█ ▀▀ ▀█
█ █   █ █▀▄▄ █▀▄█▀▄█▀▄▄   ▀▀▀██
█ █▄▄▄█ █▀ █ █▄▄█▀ █▀ ██▀▄▄▄▀▄█
█▄▄▄▄▄▄▄█▄█▄█▄▄█▄█▄▄█▄▄█▄█▄█▄██
</pre>
<p>上述即一个文本二维码，通常两行一列编码为一个半角字符，这个二维码的显示需要两个前提：</p>
<ol class="arabic simple">
<li>等宽字符，例如 Lucida Console</li>
<li>行间距尽量小，让整体显示为正方形</li>
</ol>
<p>当然，能否扫描出结果，也取决于扫描时的容差。</p>
<p>在 Windows 平台，如果终端控制台中出现文本二维码散乱情况，请调整控制台字体为等宽字体，或者打开记事本，字体选择为：Lucida Console 5号字，再进行全选，即可显示出可扫描的二维码。</p>
<p>感谢阅读。</p>
</div>
</div>
    <footer>
<p class="meta">
  <span class="byline author vcard">
    发布人： <span class="fn">
        Kaffa
    </span>
  </span>
<time datetime="2018-07-27T12:00:00+08:00" pubdate>2018-07-27 周五</time>  <span class="categories">
    <a class='category' href='./category/sui-bi.html'>随笔</a>
  </span>
  <span class="categories">
    <a class="category" href="./tag/sui-bi.html">随笔</a>,    <a class="category" href="./tag/essays.html">Essays</a>,    <a class="category" href="./tag/ji-zhu.html">技术</a>,    <a class="category" href="./tag/technology.html">Technology</a>,    <a class="category" href="./tag/qrcode.html">QRCode</a>,    <a class="category" href="./tag/text-qrcode.html">Text QRCode</a>  </span>
</p><div class="sharing">
</div>    </footer>
    <div id="gitalk-container"></div>
  </article>

</div>

<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script>
  var gitalk = new Gitalk({
    clientID: '47c6091c4039fb3df197',
    clientSecret: '8ed206e3b86fb7a90a0dd78d4ed3425d7384b45a',
    repo: 'kaffa.github.io',
    owner: 'kaffa',
    admin: ['kaffa'],
    id: location.pathname.substr(0, 50),
    distractionFreeMode: false
  });
  gitalk.render('gitalk-container');
</script>

<aside class="sidebar">
  <section>
    <h1>最近博文</h1>
    <ul id="recent_posts">
      <li class="post">
          <a href="./hario-mss-1b-mss-1r-16.html">手摇磨豆器-HARIO-MSS-1B-MSS-1R-16-的 12 个零件</a>
      </li>
      <li class="post">
          <a href="./article-39-chapter-iv-of-labor-contract-law-of-China-and-buber-and-drip-bag-coffee.html">公司为什么会选择违法解除劳动合同、包焙儿和挂耳咖啡</a>
      </li>
      <li class="post">
          <a href="./review-2022.html">2022 回顾</a>
      </li>
      <li class="post">
          <a href="./things-in-the-past-half-year-of-2022.html">2022H2半年小记</a>
      </li>
      <li class="post">
          <a href="./alaunch-your-first-productivity-software.html">ALaunch第一个生产力工具</a>
      </li>
    </ul>
  </section>
  <section>

    <h1>分类</h1>
    <ul id="recent_posts">
        <li><a href="./category/ren-wen.html">人文</a></li>
        <li><a href="./category/ri-zhi.html">日志</a></li>
        <li><a href="./category/sui-bi.html">随笔</a></li>
        <li><a href="./category/yue-du.html">阅读</a></li>
        <li><a href="./category/zi-ran.html">自然</a></li>
    </ul>
  </section>

  <section>
  <h1>标签</h1>
    <a href="./tag/sui-bi.html">随笔</a>,    <a href="./tag/essays.html">Essays</a>,    <a href="./tag/ka-pei.html">咖啡</a>,    <a href="./tag/mo-dou-qi.html">磨豆器</a>,    <a href="./tag/hario.html">Hario</a>,    <a href="./tag/ren-sheng.html">人生</a>,    <a href="./tag/life.html">Life</a>,    <a href="./tag/bao-bei-er.html">包焙儿</a>,    <a href="./tag/yue-du.html">阅读</a>,    <a href="./tag/reading.html">Reading</a>,    <a href="./tag/ruan-jian.html">软件</a>,    <a href="./tag/software.html">Software</a>,    <a href="./tag/ji-zhu.html">技术</a>,    <a href="./tag/technology.html">Technology</a>,    <a href="./tag/alaunch.html">ALaunch</a>,    <a href="./tag/productive.html">Productive</a>,    <a href="./tag/bo-ke.html">博客</a>,    <a href="./tag/my-blog.html">My Blog</a>,    <a href="./tag/gitee-pages.html">Gitee Pages</a>,    <a href="./tag/playwright.html">PlayWright</a>,    <a href="./tag/gong-zuo-guan.html">工作观</a>,    <a href="./tag/view-of-work.html">view-of-work</a>,    <a href="./tag/cat.html">Cat</a>,    <a href="./tag/mao.html">猫</a>,    <a href="./tag/wang-wen.html">网文</a>,    <a href="./tag/dian-shi-ju.html">电视剧</a>,    <a href="./tag/ke-bi-bu-lai-en-te.html">科比·布莱恩特</a>,    <a href="./tag/kobe-bryant.html">Kobe Bryant</a>,    <a href="./tag/luo-shan-ji-zao-chen-si-dian.html">洛杉矶早晨四点</a>,    <a href="./tag/los-angeles-morning-4am.html">Los Angeles Morning 4AM</a>,    <a href="./tag/markdown.html">Markdown</a>,    <a href="./tag/markdown-grammar.html">Markdown Grammar</a>,    <a href="./tag/mkdocs.html">MkDocs</a>,    <a href="./tag/hugo.html">Hugo</a>,    <a href="./tag/resume.html">Résumé</a>,    <a href="./tag/fan-qie-gong-zuo-fa.html">番茄工作法</a>,    <a href="./tag/pomodoro-technique.html">Pomodoro Technique</a>,    <a href="./tag/fan-qie-zhong.html">番茄钟</a>,    <a href="./tag/pomodoro-clock.html">Pomodoro Clock</a>,    <a href="./tag/semantic-ui.html">Semantic-UI</a>,    <a href="./tag/nodejs.html">nodejs</a>,    <a href="./tag/pplusplus.html">PPlusPlus</a>,    <a href="./tag/faq.html">FAQ</a>,    <a href="./tag/zeev-suraski.html">Zeev Suraski</a>,    <a href="./tag/internals.html">internals@</a>,    <a href="./tag/php.html">PHP</a>,    <a href="./tag/p.html">P++</a>,    <a href="./tag/rasmus-lerdorf.html">Rasmus Lerdorf</a>,    <a href="./tag/pplusplus-faq.html">PPlusPlus FAQ</a>,    <a href="./tag/microsoft-designer-mouse.html">Microsoft Designer Mouse</a>,    <a href="./tag/linux-distributions.html">Linux Distributions</a>,    <a href="./tag/arch-linux.html">Arch Linux</a>,    <a href="./tag/centos.html">CentOS</a>,    <a href="./tag/debian.html">Debian</a>,    <a href="./tag/elementary-os.html">Elementary OS</a>,    <a href="./tag/fedora.html">Fedora</a>,    <a href="./tag/freebsd.html">FreeBSD</a>,    <a href="./tag/gentoo.html">Gentoo</a>,    <a href="./tag/linux-from-scratch.html">Linux From Scratch</a>,    <a href="./tag/linux-mint.html">Linux Mint</a>,    <a href="./tag/netbsd.html">NetBSD</a>,    <a href="./tag/opensuse.html">openSuse</a>,    <a href="./tag/red-hat-enterprise-linux.html">Red Hat Enterprise Linux</a>,    <a href="./tag/slackware.html">Slackware</a>,    <a href="./tag/ubuntu.html">Ubuntu</a>,    <a href="./tag/restructuretext.html">reStructureText</a>,    <a href="./tag/restructuredtext-grammar.html">reStructuredText Grammar</a>,    <a href="./tag/vscode-extension.html">VSCode Extension</a>,    <a href="./tag/vsce.html">vsce</a>,    <a href="./tag/visual-studio-marketplace.html">Visual Studio Marketplace</a>,    <a href="./tag/macos.html">macOS</a>,    <a href="./tag/mac-os.html">Mac OS</a>,    <a href="./tag/macos-history.html">macOS History</a>,    <a href="./tag/machintosh.html">Machintosh</a>,    <a href="./tag/beos.html">BeOS</a>,    <a href="./tag/next.html">NeXT</a>,    <a href="./tag/openstep.html">OPENSTEP</a>,    <a href="./tag/mach.html">Mach</a>,    <a href="./tag/ren-wen.html">人文</a>,    <a href="./tag/humanity.html">Humanity</a>,    <a href="./tag/luo-ji-xue.html">逻辑学</a>,    <a href="./tag/logic.html">Logic</a>,    <a href="./tag/ke-ji-suan-xing.html">可计算性</a>,    <a href="./tag/shi-wu.html">事物</a>,    <a href="./tag/shi-jian.html">事件</a>,    <a href="./tag/shi-shi.html">事实</a>,    <a href="./tag/guan-nian.html">观念</a>,    <a href="./tag/ming-ti.html">命题</a>,    <a href="./tag/duan-yan.html">断言</a>,    <a href="./tag/yan-yi.html">演绎</a>,    <a href="./tag/gui-na.html">归纳</a>,    <a href="./tag/san-duan-lun.html">三段论</a>,    <a href="./tag/tong-yi-lu.html">同一律</a>,    <a href="./tag/pai-zhong-lu.html">排中律</a>,    <a href="./tag/yin-guo-lu.html">因果律</a>,    <a href="./tag/mao-dun-lu.html">矛盾律</a>,    <a href="./tag/zi-ran.html">自然</a>,    <a href="./tag/natural-science.html">Natural Science</a>,    <a href="./tag/xiong-ji-diao.html">胸棘鲷</a>,    <a href="./tag/orange-roughy.html">Orange Roughy</a>,    <a href="./tag/chang-shou-yu.html">长寿鱼</a>,    <a href="./tag/hua-shi-ren-lei-xue.html">化石人类学</a>,    <a href="./tag/gu-ren-lei-xue.html">古人类学</a>,    <a href="./tag/zhi-ren.html">智人</a>,    <a href="./tag/homo-sapiens.html">Homo sapiens</a>,    <a href="./tag/ni-an-de-te-ren.html">尼安德特人</a>,    <a href="./tag/homo.html">Homo</a>,    <a href="./tag/neanderthals.html">Neanderthals</a>,    <a href="./tag/sheng-zhi-ge-chi.html">生殖隔离</a>,    <a href="./tag/ji-yin-ce-xu.html">基因测序</a>,    <a href="./tag/ji-suan-ji-ke-xue.html">计算机科学</a>,    <a href="./tag/computer-science.html">Computer Science</a>,    <a href="./tag/dian-zi-gong-cheng.html">电子工程</a>,    <a href="./tag/electronic-engineering.html">Electronic Engineering</a>,    <a href="./tag/ruan-jian-gong-cheng-xue.html">软件工程学</a>,    <a href="./tag/software-engineering.html">Software Engineering</a>,    <a href="./tag/xin-xi-ji-zhu.html">信息技术</a>,    <a href="./tag/information-technology.html">Information Technology</a>,    <a href="./tag/geetest.html">GeeTest</a>,    <a href="./tag/windows.html">Windows</a>,    <a href="./tag/linux.html">Linux</a>,    <a href="./tag/jekyll.html">Jekyll</a>,    <a href="./tag/ruby.html">Ruby</a>,    <a href="./tag/msys2.html">MSYS2</a>,    <a href="./tag/vibora.html">Vibora</a>,    <a href="./tag/cygwin.html">Cygwin</a>,    <a href="./tag/mingw.html">MinGW</a>,    <a href="./tag/virtualpc.html">Virtualpc</a>,    <a href="./tag/vmware.html">VMWare</a>,    <a href="./tag/docker.html">Docker</a>,    <a href="./tag/msys.html">MSYS</a>,    <a href="./tag/msysgit.html">msysgit</a>,    <a href="./tag/pelican.html">Pelican</a>,    <a href="./tag/gitalk.html">Gitalk</a>,    <a href="./tag/gitment.html">Gitment</a>,    <a href="./tag/pelican-octopress-theme.html">Pelican Octopress Theme</a>,    <a href="./tag/pelican-octopress-theme-cn.html">pelican-octopress-theme-cn</a>,    <a href="./tag/node.html">Node</a>,    <a href="./tag/path.html">Path</a>,    <a href="./tag/psychology.html">Psychology</a>,    <a href="./tag/philosophy.html">Philosophy</a>,    <a href="./tag/nwjs.html">NW.js</a>,    <a href="./tag/electron.html">Electron</a>,    <a href="./tag/qrcode.html">QRCode</a>,    <a href="./tag/text-qrcode.html">Text QRCode</a>,    <a href="./tag/wechaty.html">Wechaty</a>,    <a href="./tag/open-source.html">Open Source</a>,    <a href="./tag/vscode.html">VSCode</a>,    <a href="./tag/linux-kernel.html">Linux Kernel</a>,    <a href="./tag/data.html">Data</a>,    <a href="./tag/information.html">Information</a>,    <a href="./tag/restructuredtext.html">reStructuredText</a>,    <a href="./tag/rst.html">rst</a>,    <a href="./tag/blog.html">Blog</a>,    <a href="./tag/zi-ding-yi-yu-ming.html">自定义域名</a>,    <a href="./tag/custom-domain.html">Custom Domain</a>,    <a href="./tag/github-pages.html">GitHub Pages</a>,    <a href="./tag/cname.html">CNAME</a>,    <a href="./tag/ji-zhu-zhi-shi-fen-lei.html">技术知识分类</a>,    <a href="./tag/technology-category.html">Technology Category</a>,    <a href="./tag/wen-ti-jie-jue.html">问题解决</a>,    <a href="./tag/problem-solving.html">Problem Solving</a>,    <a href="./tag/biao-ji-yu-yan.html">标记语言</a>,    <a href="./tag/octopress.html">octopress</a>,    <a href="./tag/asciidoc.html">AsciiDoc</a>  </section>


    <section>
        <h1>社区</h1>
        <ul>
            <li><a href="https://github.com/kaffa" target="_blank">My GitHub</a></li>
        </ul>
    </section>
    <section>
        <h1>链接</h1>
        <ul>
            <li><a href="http://paulgraham.com" target="_blank">Paul Graham</a></li>
            <li><a href="https://gvanrossum.github.io/" target="_blank">Guido van Rossum</a></li>
            <li><a href="https://kaffa.im" target="_blank">Kaffa</a></li>
            <li><a href="https://coffees.app" target="_blank">Coffee's</a></li>
            <li><a href="https://lundao.pub/" target="_blank">论道</a></li>
        </ul>
    </section>

</aside>    </div>
  </div>
  <footer role="contentinfo"><p>
    版权所有 &copy;  2018&ndash;2023  Kaffa &mdash;
  <span class="credit">自豪地采用 <a href="http://getpelican.com">Pelican</a> 技术</span>
</p></footer>
  <script src="./theme/js/modernizr-2.0.js"></script>
  <script src="./theme/js/ender.js"></script>
  <script src="./theme/js/octopress.js" type="text/javascript"></script>
  
</body>
</html>